package com.bluefish.bltuan.module.msg;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;

import com.bluefish.bltuan.module.Category;
import com.bluefish.bltuan.module.user.User;

@Entity
public class Message implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = -1233223224772123958L;
	
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Integer id;
	
	@OneToOne
	private User from;
	
	@OneToOne
	private User to;
	
	private boolean readed;
	
	private Date timeline;
	
	private boolean replied;
	
	private String content;
	
	private String repliedContent;
	
	private Date repliedTime;
	
	@Enumerated
	private MessageType type;
	
	@OneToOne
	private Category city;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public User getFrom() {
		return from;
	}

	public void setFrom(User from) {
		this.from = from;
	}

	public User getTo() {
		return to;
	}

	public void setTo(User to) {
		this.to = to;
	}

	public boolean isReaded() {
		return readed;
	}

	public void setReaded(boolean readed) {
		this.readed = readed;
	}

	public Date getTimeline() {
		return timeline;
	}

	public void setTimeline(Date timeline) {
		this.timeline = timeline;
	}

	public boolean isReplied() {
		return replied;
	}

	public void setReplied(boolean replied) {
		this.replied = replied;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public MessageType getType() {
		return type;
	}

	public void setType(MessageType type) {
		this.type = type;
	}

	public String getRepliedContent() {
		return repliedContent;
	}

	public void setRepliedContent(String repliedContent) {
		this.repliedContent = repliedContent;
	}

	public Date getRepliedTime() {
		return repliedTime;
	}

	public void setRepliedTime(Date repliedTime) {
		this.repliedTime = repliedTime;
	}
	
	public void setCity(Category city) {
		this.city = city;
	}
	
	public Category getCity() {
		return city;
	}

}
